﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Star.Tools.BaseModel
{
    [Serializable]
    public class JsonResult
    {
        public JsonResult()
        {

        }
        public JsonResult(bool success, string msg)
        {
            this.Success = success;
            this.Msg = msg;
        }
        public bool Success { get; set; }
        public string Msg { get; set; }
        public object Data { get; set; }

    }
    public class JsonData
    {
        private string _data;
        private string _type;

        public JsonData(string __data, string __type)
        {
            this._data = __data;
            this._type = __type;
        }

        public string data
        {
            get
            {
                return this._data;
            }
            set
            {
                this._data = value;
            }
        }

        public string type
        {
            get
            {
                return this._type;
            }
            set
            {
                this._type = value;
            }
        }
    }

    public class Json
    {
        private JsonData _data;
        private int _error = 0;

        public Json(string val, string __type)
        {
            this._data = new JsonData(val, __type);
        }

        public JsonData data
        {
            get
            {
                return this._data;
            }
        }

        public int error
        {
            get
            {
                return this._error;
            }
            set
            {
                this._error = value;
            }
        }
    }
}
